/*
 * @Author: yaolunmao
 */
/*
 * @Author: yaolunmao
 */
import { createApp } from 'vue/dist/vue.esm-bundler.js';
import Antd from 'ant-design-vue';
import App from './App.vue';
import Vue3ColorPicker from 'vue3-colorpicker';
import 'vue3-colorpicker/style.css';
import 'ant-design-vue/dist/antd.css';
import UCore from './util/UCore.js';
import './assets/css/index.css';
import '@vuemap/vue-amap/dist/style.css';
import '@/assets/css/svgAnimation/index.css';
import router from './router';
import axios from 'axios';
import DataVVue3 from '@kjgl77/datav-vue3';
import ECharts from 'vue-echarts';
import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap';
import { httpRequest } from '@/network/index.js';
import { store } from './store/store.js';
import { Storage } from '@/util/storage.js';

//init the map
initAMapApiLoader({
  key: process.env.VUE_APP_AK,
  // version: '2.1Beta',
  plugins:['AMap.DistrictSearch']
});
//amap配置(development:嵌入式网页使用不同环境的地址)
const mapUrl =
  process.env.NODE_ENV == 'development'
    ? Storage.get('developUrl')
    : process.env.VUE_APP_URL;
//  nginx 代理
window._AMapSecurityConfig = {
  serviceHost: `${mapUrl}/_AMapService`,
};

const app = createApp(App);
app.use(router);
app.use(Vue3ColorPicker);
app.use(VueAMap);
app.use(DataVVue3);
app.config.globalProperties.$httpRequest = httpRequest;
app.config.globalProperties.$store = store;
app.config.globalProperties.$UCore = UCore;
app.config.globalProperties.$axios = axios;
app.component('v-chart', ECharts);
app.use(Antd).mount('#app');
